<div class="post">
  <div class="post_user_header"><%=render :partial => "users/user_info", :locals => {:post => post} %></div>
  <span class="post_header"><%=h post.title %></span>
  <%= " <div class=\"post_body\" id=\"post_#{post.id}\">" %>
    <% if post.calculate_score.to_i > -10 %>
      <%= render :partial => 'posts/show_post_body', :locals => {:post => post }  %>
    <%  else %>
      <span style="font-style: italic; color: gray;">This post has been hidden because of a low community rating. <%= link_to_remote( "(Click To Show)", :url => "/posts/show_post_body/#{post.id}", :method =>"get",:update => "post_#{post.id}"  ) %></span>
    <%  end %>
  <%= "</div>" %>
</div>
  <div class="rating">
    <%= link_to_remote( "<img src=\"/images/buttons/neg.jpg\" alt=\"Down Vote\"/>", :url => "/votes/#{post.id}/n", :method =>"get",:update => "score_#{post.id}"  ) %>
    <%= link_to_remote( "<img src=\"/images/buttons/pos.jpg\" alt=\"Up Vote\"/>", :url => "/votes/#{post.id}/p", :method =>"get",:update => "score_#{post.id}"  ) %>
    <%= "<span class=\"score\" id='score_#{post.id}'>" %><%= render :partial => 'votes/post_score', :locals => { :post => post } %><%="</span>"%>
  </div>
<% if post.user_id == session[:user_id] || is_admin(session[:user_id])%>
  <div class="button_border">
    <a href="../../posts/edit/<%= post.id %>" class="button">Edit</a><a href="../../posts/delete/<%=  post.id %>" class="button">Delete</a>
  </div>
<%  end %>